<?php

/**
 * 
 * @author alvaroj
 *
 */
Class SemesterDAO extends CommonDAO{
	
	private $sqlSelect=' SELECT R.SEMESTER FROM REQ_SEMESTER R ';
	
	public function SemesterDAO($pdbConnection){
		$this->setDBConnection($pdbConnection);
	}
	
	public function getAll(){
		$db = $this->getDBConnection();
		$stmt=$db->exec($this->sqlSelect); 
		$lstSemesters = new ArrayList();
		while ($row=$db->getRow($stmt,0)){
			$semesterVO = $this->bindValues($row);
	   		$lstSemesters->add($semesterVO); 
		}
		return $lstSemesters;
	}

	/**
	 * Map the columns into Value Object representation
	 * @param $row
	 * @return SemesterVO
	 */
	private function bindValues($row){
		$semesterVO = new SemesterVO();
		$semesterVO->semester = $row['SEMESTER'];
		return $semesterVO;
	}
}